package com.lysh.aliHttp.common.enums;

/**
 * @author liyishan
 * @date 2023/5/5 09:50
 * @apiNote
 */

public enum CannedAccessControlList {
    Default("default"),
    Private("private"),
    PublicRead("public-read"),
    PublicReadWrite("public-read-write");

    private String cannedAclString;

    private CannedAccessControlList(String cannedAclString) {
        this.cannedAclString = cannedAclString;
    }

    public String toString() {
        return this.cannedAclString;
    }

    public static CannedAccessControlList parse(String acl) {
        CannedAccessControlList[] arr$ = values();
        int len$ = arr$.length;

        for(int i$ = 0; i$ < len$; ++i$) {
            CannedAccessControlList cacl = arr$[i$];
            if (cacl.toString().equals(acl)) {
                return cacl;
            }
        }

        throw new IllegalArgumentException("Unable to parse the provided acl " + acl);
    }
}
